#ifndef QMAILMODEL_H
#define QMAILMODEL_H

#include <QAbstractListModel>

class QMailModel : public QAbstractListModel
{
    Q_OBJECT

public:
    explicit QMailModel(const QStringList &list,QObject *parent = nullptr)
        : QAbstractListModel(parent) , stringList(list){}

    // Header:
    QVariant headerData(int section,
                        Qt::Orientation orientation,
                        int role = Qt::DisplayRole) const override;

    // Basic functionality:
    int rowCount(const QModelIndex &parent = QModelIndex()) const override;

    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;

   Qt::ItemFlags flags(const QModelIndex &index) const override;
    bool setData(const QModelIndex &index,const QVariant &value,int role = Qt::EditRole) override;

   bool insertRows(int position,int rows ,const QModelIndex &index = QModelIndex()) override;

   bool removeRows(int position,int rows ,const QModelIndex &index = QModelIndex()) override;



private:
    QStringList stringList;
};

#endif // QMAILMODEL_H
